package org.msb.accentis.data;

import java.util.List;
import java.util.Map;

public interface IDataManager {

	<T> void addDataManagerListener(IDataManagerListener<T> listener, Class<T> objectClass);
	
	<T> void removeDataManagerListener(IDataManagerListener<T> listener);

	void closeEntityManager();
	
	void flushData();
	
	void initialize();
	
	<T> T persist(T object);
	
	<T> void refresh(T object);
	
	<T> void remove(T object);
	
	<T> void save(T object);
	
	<T> List<T> runNamedQuery(String queryName);
	
	<T> List<T> runNamedQuery(String queryName, Map<String, Object> parameters);
	
	<T> T runSingleResultNamedQuery(String queryName, Map<String, Object> parameters);
	
	<T> T runSingleResultNamedQuery(String queryName);
}
